

<?php if ($this->Session->read('Auth.User.role_id') == 1 || $this->Session->read('Auth.User.role_id') == 2) { ?>
<div id="breadcrumbs"><?php echo $this->Html->link('Home', array('controller' => 'contents', 'action' => 'view', 'home')); ?> > List Archived Newsletters
</div>
    <div class="archivednl index">
        <h2><?php echo __('Archived Newsletters'); ?></h2>
        <table cellpadding="0" cellspacing="0">
            <tr>
                <th>Filename</th>
                <th>Upload Date</th>
                <th>Description</th>
                <th>View</th>
                <th>Delete</th>
            </tr>
            <?php foreach ($uploads as $upload): ?>
                <tr>
                    <td><?php echo h($upload['Nlupload']['FILENAME']); ?></td>
                    <td><?php echo h($upload['Nlupload']['UPLOADDATE']); ?></td>
                    <td><?php echo h($upload['Nlupload']['DESCRIPTION']); ?></td>
                    <td><?php echo $this->Html->image('view.png', array('alt' => 'View', 'url' => '//files/newsletters/' . $upload['Nlupload']['FILENAME'])); ?></td>
                    <td><?php echo $this->Form->postLink($this->Html->image('delete.png', array('alt' => __('Delete'))), array('action' => 'delete', $upload['Nlupload']['nl_id']), array('escape' => false, 'confirm' => __('Are you sure you want to delete ' . $upload['Nlupload']['FILENAME'] . '?'))); ?> </td>			
                </tr>
            <?php endforeach; ?>
        </table>
        <div class="paging">
            <?php
            echo $this->Paginator->prev('< ' . __('Previous'), array(), null, array('class' => 'prev disabled'));
            echo $this->Paginator->numbers(array('separator' => ''));
            echo $this->Paginator->counter(array('format' => __('Page {:page} of {:pages}')));
            echo $this->Paginator->next(__('Next') . ' >', array(), null, array('class' => 'next disabled'));
            ?>
        </div>
    </div>
    <div class="actions">
        <h3><?php echo __('Actions'); ?></h3>
        <ul>
            <li><?php echo $this->Html->link(__('New Newsletter'), array('action' => 'add')); ?></li>
        </ul>
    </div>
<?php }else { ?>
<div id="breadcrumbs"><?php echo $this->Html->link('Home', array('controller' => 'contents', 'action' => 'view', 'home')); ?> > Newsletters
</div>

    <h2>Here are a list of newsletters</h2> <br>

    <?php foreach ($uploads as $upload): ?>
        <tr>
        <li><td><?php echo $this->Html->link($upload['Nlupload']['DESCRIPTION'], '//files/newsletters/' . $upload['Nlupload']['FILENAME']); ?></td>
        <td><?php echo $this->Format->dateFormat($upload['Nlupload']['UPLOADDATE']); ?></td></li>	
        </tr>
    <?php endforeach; ?>
<?php } ?>
